<!--复选框-->
<template>
  <div class="example">
    <zz-weibo
      :option = item
      :key="item.msgId"
      @success="getWeiboList"
      form = "form.msg_id"
      :subUrl= subUrl
      query = "weiBoMsg.msg_id"
      delQuery = "reply.reply_id"
      :delUrl =delUrl
      childQuery = "query.msg_id"
      :childUrl = childUrl
      :delChildUrl = delChildUrl
      :addPraise = addPraise
      :deletePraise = deletePraise
      v-for="item in weiboList"></zz-weibo>
    <div class="tableClass">
      <table cellspacing="0">
        <tr>
          <th>1) 调用文件组件</th>
        </tr>
        <tr>
          <td><pre>{{explameCall}}</pre></td>
        </tr>
        <tr>
          <th>2) 写入到methods方法</th>
        </tr>
        <tr>
          <td><pre>{{explameMethods}}</pre></td>
        </tr>
      </table>
    </div>
  </div>
</template>

<script>

  export default {
    name: '',
    data () {
      return {
        subUrl: '',
        delUrl: '',
        childUrl: '',
        delChildUrl: '',
        addPraise: '',
        deletePraise: '',
        weiboList: [],
        explameCall: `<zz-weibo
          option="[]"  传入的列表
          form = "form.msg_id"  提交评论时 需要传服务端的参数
          formName = "form"  如果需要自定义 form
          :isWeqiaNo="false"  传人员时 是否用 桩桩号
          isBorder="false"  输入框 是否启用 边框
          query="weiBoMsg.msg_id"  删除分享时 传给服务端的参数
          :isUpload="false"  是否打开上传
          :isDelete="true"  是否显示删除
          :subUrl=""  提交内容接口
          delUrl="" 删除内容接口
          delQuery = '' 删除内容参数
          childUrl = '' 请求子回复列表内容接口
          childQuery = '' 请求子回复列表参数
          delChildUrl = '' 删除子回复接口
          addPraise = '' 赞接口
          deletePraise = '' 取消赞接口
          :simple="false"  是否开启简单模式
          :isSpreadOut="false"  是否自动展开子评论
          ></zz-weibo>`,

        explameMethods:
          `del (state) {
            this.state = state
            console.log(this.state)
          }`
      }
    },
    mounted () {
      this.getWeiboList()
    },
    methods: {
      del (state) {
        this.state = state
      },
      getWeiboList () {
        let data = {
          'query.schType': this.weiboType,
          'query.empId': '',
          'query.classify_id': this.classifyId
        }
        this.$axios({
          method: 'post',
          url: `${this.$site.oaServer}/front/weiboList.htm`,
          data: this.$qs.stringify(data, {indices: false}),
          paginate: true
        }).then(res => {
          if (res.data.errorMsg) {
            this.$message.error(res.data.errorMsg)
          } else {
            this.weiboList = res.data.list
          }
        })
      }
    }
  }
</script>
<style lang="scss" scoped>
  .example{
    padding: 20px;
    .example-left{
      float: left;
      width: 20%;
    }
    .example-right{
      float: right;
      width: 78%;
      background: #fff;
      padding: 20px;
    }
  }
</style>
